fix(ci): fix SonarCloud coverage — use src/**/*.spec.ts instead of test/#8
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the SonarCloud scan configuration in the release-check CI workflow to better align Sonar’s test detection with this repo’s actual Jest test layout (tests primarily live under src/**/*.spec.ts rather than only under test/).
Changes:
- Replaces
sonar.tests=testwithsonar.test.inclusions=src/**/*.spec.tsin the SonarCloud scan step.
| -Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} | ||
| -Dsonar.sources=src | ||
| -Dsonar.tests=test | ||
| -Dsonar.test.inclusions=src/**/*.spec.ts |
There was a problem hiding this comment.
jest.config.ts runs tests from both src/**/*.spec.ts and test/**/*.test.ts, but the Sonar config now only marks src/**/*.spec.ts as tests. This will cause the test/ suite (e.g. test/smoke.test.ts) to be ignored/misclassified in SonarCloud. Consider setting sonar.tests to include both src and test and expanding sonar.test.inclusions accordingly (and, if needed, excluding **/*.spec.ts from sonar.sources to avoid counting tests as main sources).
| -Dsonar.test.inclusions=src/**/*.spec.ts | |
| -Dsonar.tests=src,test | |
| -Dsonar.test.inclusions=src/**/*.spec.ts,test/**/*.test.ts | |
| -Dsonar.exclusions=src/**/*.spec.ts |
Summary
Why
Checklist
npm run lintpassesnpm run typecheckpassesnpm testpassesnpm run buildpassesnpx changeset) if this affects consumersNotes